﻿using System;
using System.Linq;

namespace Lawn.AppServer
{
    public static class StringExtensions
    {
        public static string To2Hex(this byte[] data)
        {
            if (data == null) return string.Empty;

            var arry = data.Select((x, i) => Convert.ToString(x, 16).PadLeft(2, '0'));

            return string.Join(" ", arry);
        }
    }
}